Popover: Include window shadows in overshoot calcs
authorDaniel Boles <dboles@src.gnome.org>
Wed, 23 Aug 2017 20:44:10 +0000 (21:44 +0100)
committerDaniel Boles <dboles@src.gnome.org>
Thu, 24 Aug 2017 20:32:05 +0000 (21:32 +0100)
commit12693c6fe31692d42552793a227d280917d35d6e
tree6706237b21647afc11a3ce06664694dc28644179
parent1e832b2e162786c57c09752811f916071d070eb9
Popover: Include window shadows in overshoot calcs

.update_position() enforces that non-Wayland platforms must position a
Popover within its parent Window. We use the allocation of the Window
to translate the position and check for overshoot on each of its sides.
Calling Widget.get_allocation() of a CSD Window includes its shadows.

But shadows were not excluded from the area in which we can position.
Thus, Popovers could get positioned in the shadow of CSD windows, where,
at least on X11, no input is received. Therefore, positioning a Popover
over a shadow meant its child widgets within that area became unusable.

Fix by calling Window.get_shadow() and including it in the overshoot on
each side. This adjusts for how the allocation includes shadows, making
overshoots with and without shadows the same. Thus, we avoid considering
shadows as viable for positioning, favouring a side where input works.

https://bugzilla.gnome.org/show_bug.cgi?id=786209
gtk/gtkpopover.c